version: "3.2"

services:

  mindsdb:
    image: mindsdb/mindsdb:dev
    # If you want to build the image instead:
    # build:
    #   context: .
    #   dockerfile: docker/mindsdb.Dockerfile
    #   target: dev  # Makes sure dev dependencies are installed
    restart: always
    ports:
      - '47334:47334'
      - '47335:47335'
      - '47336:47336'
    # watchfiles will reload the app when python files are changed
    command: bash -c "watchfiles --filter python 'python -m mindsdb' ."
    environment:
      MINDSDB_DOCKER_ENV: "True"
      MINDSDB_STORAGE_DIR: "/mindsdb/var"
      FLASK_DEBUG: 1  # This will make sure http requests are logged regardless of log level
      # MINDSDB_LOG_LEVEL: "DEBUG"
      # OPENAI_API_KEY: "..."
    volumes:
      - type: bind
        source: .
        target: /mindsdb
    healthcheck:
      test:  ["CMD", "curl", "-f", "http://localhost:47334/api/util/ping"]
      interval: 30s
      timeout: 4s
      retries: 100
